<template>
  <div v-if="Object.keys(info).length !== 0" class="base-info">


    <div class="info-title">{{info.title}}</div>
    <div class="info-price">
      <span class="n-price">{{info.newPrice}}</span>
      <span class="old-price">{{info.oldPrice}}</span>
      <span v-if="info.discount" class="discount">{{info.discount}}</span>
    </div>

    <div class="columns">
      <span> {{info.columns[0]}}</span>
      <span> {{info.columns[1]}}</span>
      <span>{{info.serveices[info.serveices.length-1].name}}</span>
    </div>

    <div class="service">
      <span class="info-service-item" v-for="index in info.serveices.length-1" :key="index">
        <img :src="info.serveices[index-1].icon">
        <span>{{info.serveices[index-1].name}}</span>
      </span>
    </div>


  </div>
</template>

<script>
  export default {
    name: "DetailInfo",
    props:{
      info:{
        type:Object,
        default(){
          return {};
          }
      },


    },



  }
</script>

<style scoped>
  .info-title {
    margin-top: 10px;
    font-weight: 550;
  }
  .info-price {
    margin-top: 10px;
  }
  .info-price .n-price {
    font-size: 22px;
    color: var(--color-tint);
  }
  .info-price .old-price {
    margin-left: 5px;
    font-size: 13px;
    text-decoration: line-through;
  }
  .info-price .discount {
    color: #fff;
    display: inline-block;
    padding: 2px 5px;
    text-align: center;
    border-radius: 10px;
    margin-left: 7px;
    background: var(--color-height-text);
    vertical-align: 5px;
  }
  .columns {
    display: flex;
    justify-content: space-between;
    margin-top: 10px;
    font-size: 12px;
    color: rgba(0, 0, 0, 0.6);
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(100, 100, 100, 0.1);
  }

  .service {
    display: flex;
    justify-content: space-between;
    padding: 15px 0 15px 0;
    font-size: 14px;
    border-bottom: 4px solid #f6f6f6;
    color: #333;
  }
  .service img {
    width: 11px;
    height: 11px;
  }

</style>
